package com.chang.spring6;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestUser {

    // 创建log对象
    private static Logger logger = LoggerFactory.getLogger(TestUser.class);

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        User user = (User) context.getBean("user");
        System.out.println(user);
        user.add();

        // 手动写入日志
        logger.info("执行调用成功了>>>>>>");
    }

}
